<!DOCTYPE html>
<html lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="tcal.css" />
<script type="text/javascript" src="tcal.js"></script> 
<script language="JavaScript" type="text/javascript" src="ajax2.js"></script>
<script language="JavaScript" type="text/javascript" src="includes/script1.js"></script>
<script src="includes/jquery-1.8.3.js"></script>
<script src="includes/js/jquery-ui-notarios.js"></script>

<title>Indice Cronologico de Permisos de Viaje</title>
<style type="text/css">
<!--
.line {color: #FFFFFF}
.titulosprincipales {	font-family: Calibri;
	font-size: 18px;
	color: #FF9900;
	font-style: italic;
}
div.frmcrono {  background-color: #ffffff;
border: 4px solid #264965;  

-moz-border-radius: 13px;
-webkit-border-radius: 13px;
border-radius: 13px;
-moz-box-shadow: 0px 0px 5px #000000;
-webkit-box-shadow: 0px 0px 5px #000000;
box-shadow: 0px 0px 5px #000000;
width:900px; height:800px;
}
.Estilo7 {font-family: Calibri; font-size: 13px; font-style: italic; }
.Estilo14 {font-family: Calibri; font-size: 12px; color: #333333; font-weight: bold; }
.Estilo12 {font-family: Calibri; font-size: 12px; color: #333333; font-style: italic; }
-->
</style>
<script type="text/javascript">
function objetoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
  		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

// BUSQUEDA DE CARTAS EN INDICE DE CARTAS:
function buscacamara(){

	divResultado = document.getElementById('buscaviaje');
	divResultado.innerHTML= '<img src="loading.gif">';
	
	var fechade = document.getElementById('fechade').value;
	var fechaa  = document.getElementById('fechaa').value; 
	var _text_check = document.getElementById('text_check').value;
	var _chk_uno = document.getElementById('chk_uno').checked;
	var _chk_dos = document.getElementById('chk_dos').checked;

	if (_chk_uno == false && _chk_dos == false ) {
		
		alert('Debe seleccionar tipo de feca');} 
    
	ajax=objetoAjax();

	ajax.open("POST", "buscacamara.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			divResultado.innerHTML = ajax.responseText
		}
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send("fechade="+fechade+"&fechaa="+fechaa+"&text_check="+_text_check)
}

// INDICE CARTAS
function pdfgmovi(fecini,fecfin,html){
	var _check = document.getElementById('chk_uno').checked;
	var _check1 = document.getElementById('chk_dos').checked;

	if (_check == true) {var chk = "1";} 
	else if(_check1 == true){var chk = "2";} 

		
	ajax=objetoAjax();
	ajax.open("POST", "PDFprotesto.php",true);
	
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4 && ajax.status==200) {
			window.open("PDFprotesto.php?fecini="+fecini+"&fecfin="+fecfin+"&condicion="+chk); 
		}
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send("fecini="+fecini+"&fecfin="+fecfin+"&condicion="+chk);
}

// Activa o Desactiva el CHECKBOX NO CORRE:
function EvalNoCorre()
{
	var fechade = document.getElementById('fechade').value;
	var fechaa  = document.getElementById('fechaa').value; 

	var _swtnocorre = document.getElementById('chk_nocorre').checked;

		if (_swtnocorre == true)
			{  
			   var nc = "nc"; 
			   $("#buscaviaje").load('buscaviaje.php',{ fechade: fechade, fechaa: fechaa, nocorre : nc });
			} 
	    else{
			   var nc = ""; 
			   $("#buscaviaje").load('buscaviaje.php',{ fechade: fechade, fechaa: fechaa, nocorre : nc });
			}		
		
}
	function fadd(_obj)
	{
	if(_obj == true){
		
	 	var _num = parseInt(document.getElementById('text_check').value);
			document.getElementById('text_check').value = 1;
		}
	
	}
	function fadd1(_obj)
	{
	if(_obj == true){
		
	
	 	var _num = parseInt(document.getElementById('text_check').value);
			document.getElementById('text_check').value = 2;
		}
	
	}
	
	function fadd2(_obj)
	{
	if(_obj == true){
		

	 	var _num = parseInt(document.getElementById('text_check').value);
			document.getElementById('text_check').value = 3;
		}
	
	}

</script>

</head>

<body>
<div class="frmcrono">
  <table width="900" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="30" bgcolor="#264965"><table width="900" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="33" height="30"><img src="iconos/newproto.png" alt="" width="26" height="26" /></td>
          <td width="354"><span class="titulosprincipales">Indice Cronológico de Permisos de Protestos</span></td>
          <td width="484" align="left"><table width="454" border="0" align="right" cellpadding="0" cellspacing="0">
            <tr>
              <td width="239" height="30">&nbsp;</td>
              <td width="80">&nbsp;</td>
              <td width="17"><span class="line">|</span></td>
              <td width="118">&nbsp;</td>
            </tr>
          </table></td>
          <td width="29"><img src="iconos/cerrar.png" width="21" height="20" /></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td height="19">&nbsp;</td>
    </tr>
    <tr>
      <td align="center"><table width="863" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="824" height="18"><form id="frmescri" name="frmescri" method="post" action="">
            <table width="834" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="113"><span class="camposss">Tipo de Fecha </span></td>
<td width="59"><label for="d"><span class="Estilo7">Constancia</span></label></td>
<td width="44"><input onClick="fadd(this.checked);" checked  type="checkbox" name="chk_uno" id="chk_uno"></td>
          		 <td width="77"><span class="Estilo7">Notificacion</span></td>
          		 <td width="52"><input onClick="fadd1(this.checked);"  type="checkbox" name="chk_dos" id="chk_dos"></td>
          		 <td width="48">&nbsp;</td>
          		 <td width="24">&nbsp;</td>
          		 <td width="173"> <input name="text_check" type="hidden" id="text_check" value="1"/></td>
              </tr>
              
              <tr>
                <td width="113"><span class="camposss">Desde</span></td>
                <td colspan="3"><span class="Estilo7">
                  <label>
                    <input name="fechade" type="text" class="tcal" id="fechade" maxlength="12" />
                    </label>
                </span></td>
                <td>Hasta</td>
                <td colspan="2">&nbsp;</td>
                <td width="173"><label>
                  <input name="fechaa" type="text" class="tcal" id="fechaa" maxlength="12" />
                </label></td>
                <td width="95"><a href="#" onclick="buscacamara()"><img src="iconos/buscarclie.png" width="72" height="29" border="0" /></a></td>
               
                <td width="17"><!--<img src="iconos/impresora.png" alt="" width="33" height="31" border="0" />--></td><td width="132"><a href="#" onclick="pdfgmovi(document.getElementById('fechade').value,document.getElementById('fechaa').value),document.getElementById('text_check').value;"><img src="iconos/icon_pdf.png" alt="" width="33" height="31" border="0" /></a></td>
              </tr>
            </table>
                    </form>          </td>
        </tr>
        <tr>
          <td height="9">---------------------------------------------------------------------------------------------------------------------------------------------</td>
        </tr>
        <tr>
          <td height="22"><table width="834" border="1" cellpadding="0" cellspacing="0" bordercolor="#333333"><!--<td width="70" height="19" bgcolor="#CCCCCC"><span class="Estilo14">Numero</span></td>-->
            <tr>
                <td width="15" bgcolor="#CCCCCC" align="center"><span class="Estilo14">C.P</span></td>
                <td width="60" bgcolor="#CCCCCC" align="center"><span class="Estilo14">Fec. Not.</span></td>
                <td width="60" bgcolor="#CCCCCC" align="center"><span class="Estilo14">Fec. Prot.</span></td>
                <td width="20" bgcolor="#CCCCCC" align="center"><span class="Estilo14">TIT Val</span></td>
                <td width="50" bgcolor="#CCCCCC" align="center"><span class="Estilo14">Monto</span></td>
                 <td width="130" bgcolor="#CCCCCC" align="center"><span class="Estilo14">Solicitante</span></td>
                 <td width="150" bgcolor="#CCCCCC" align="center"><span class="Estilo14">Aceptante/Aval</span></td>
                 <td width="60" bgcolor="#CCCCCC" align="center"><span class="Estilo14">Ruc/Doc Identidad</span></td>
             	<td width="150" bgcolor="#CCCCCC" align="center"><span class="Estilo14">Direccion Obligado o Aval</span></td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td><div id="buscaviaje" style="height:600px; overflow:auto;"></div></td>
        </tr>
      </table></td>
    </tr>
  </table>
</div>
</body>

</html>
